<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:c="http://java.sun.com/jstl/core"
    template="layout/template.xhtml">

    <ui:define name="l_content">
		<ui:include src="/l_content/lc.xhtml" />
    </ui:define>
    
    <ui:define name="body">
    	<c:if test="#{kProfileManager.error}" >
    		<h:outputText value="#{messages.error_msg}" />
    	</c:if>
    	<c:if test="#{!kProfileManager.error}" >
    	<h:panelGroup id="profile_panel">
    		<h:form id="my_account_form">
	    		<table>
	    			<tr>
	    				<td>
	    					<table cellpadding="5" cellspacing="5">
					    		<tr>
					    			<td colspan="2">
					    				<h:panelGroup id="thumb_img" rendered="#{not empty kProfileManager.img}">
											<img id="thumb_" src="/#{kInitParam.imgPath}/av_#{kProfileManager.img.userId}/#{kProfileManager.img.thumb}" />
										</h:panelGroup>
										<h:graphicImage value="/img/no-img.gif" rendered="#{empty kProfileManager.img}"/>
					    			</td>
					    		</tr>
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.type_msg}" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.userType.message}" />
					    			</td>
					    		</tr>
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.kadrons_msg}" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.kadrons}" />
					    			</td>
					    		</tr>
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.k_name_msg}" />
					    				<h:outputText value="*" styleClass="m" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.username}" />
					    			</td>
					    		</tr>
					    		<c:if test="#{kProfileManager.user.emailVisible}">
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.email_msg}" />
					    				<h:outputText value="*" styleClass="m" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.email}" />
					    			</td>
					    		</tr>
					    		</c:if>
					    		<c:if test="#{kProfileManager.user.nameVisible}">
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.firstname_msg}" />
						    			<h:outputText value="*" styleClass="m" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.firstname}" />
					    			</td>
					    		</tr>
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.lastname_msg}" />
					    				<h:outputText value="*" styleClass="m" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.lastname}" />
					    			</td>
					    		</tr>
					    		</c:if>
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.address_msg}" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.address}" />
					    			</td>
					    		</tr>
					    		<c:if test="#{kProfileManager.user.telVisible}">
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.tel_msg}" />
					    				<h:outputText value="*" styleClass="m" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.tel}" />
					    			</td>
					    		</tr>
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.mob_msg}" />
					    				<h:outputText value="*" styleClass="m" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.mob}" />
					    			</td>
					    		</tr>
					    		</c:if>
					    		<c:if test="#{kProfileManager.user.birthdayVisible}">
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.birthday_msg}" />
					    				<h:outputText value="*" styleClass="m" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.birthday}" />
					    			</td>
					    		</tr>
					    		</c:if>
					    		<tr>
					    			<td>
					    				<h:outputText value="#{messages.desc_msg}" />
					    			</td>
					    			<td>
					    				<h:outputText value="#{kProfileManager.user.desc}" />
					    			</td>
					    		</tr>
					   		</table>
	    				</td>
		    			<td valign="top">
		    				<h:panelGroup styleClass="no_border">
		    					<h:outputText value="#{messages.favorites_msg}" styleClass="b"/>
		    					<hr width="250"/>
			    				<rich:dataTable id="favs_" value="#{kProfileManager.favoriteList}" var="e" rows="5" 
									rendered="#{kProfileManager.favoriteList.size gt 0}" style="width:250px !important;" >
									<rich:column width="250" styleClass="no_border">
										<table width="100%" >
											<tr>
												<td width="52">
													<h:panelGroup rendered="#{e.thumbAvb}">
														<a href="#{facesContext.externalContext.requestContextPath}/k_item.k?itemId=#{e.item.id}" >
															<img src="/#{kInitParam.imgPath}/i_#{e.item.id}/#{e.thumb}" width="90" height="90"/>
														</a>
													</h:panelGroup>
												</td>
												<td valign="top" style="padding-left: 10px;">
													<a href="#{facesContext.externalContext.requestContextPath}/k_item.k?itemId=#{e.item.id}" >
														<h:outputText value="#{e.item.getName(kUser.klang)}" styleClass="b"/>&#160;
													</a>
													<br />
													<h:outputText value="#{e.created}" styleClass="gray">
														<s:convertDateTime pattern="dd MMM yyyy HH:mm"/>
													</h:outputText>
												</td>
											</tr>
										</table>
									</rich:column>
								</rich:dataTable>
								<rich:datascroller for="favs_" renderIfSinglePage="false" />
		    				</h:panelGroup>
		    			</td>
	    			</tr>
	    		</table>
	    	</h:form>
    	</h:panelGroup>
    	</c:if>
    </ui:define>
</ui:composition>
